<!doctype html>
<html  class="x-admin-sm">
<head>
    {include file='base/common_header'}
    <link rel="stylesheet" href="/static/css/login.css">
</head>
<body class="login-bg">

<div class="login layui-anim layui-anim-up">
    <div class="message">测评小程序后台密码修改</div>
    <div id="darkbannerwrap"></div>

    <form method="post" class="layui-form" >
        <input name="old_pwd" placeholder="当前密码"  type="password" lay-verify="required" class="layui-input username" >
        <hr class="hr15">
        <input name="password" lay-verify="required" placeholder="新密码"  type="password" class="layui-input pwd">
        <hr class="hr15">
        <input value="确认修改" lay-submit lay-filter="login" style="width:100%;" type="submit">
        <hr class="hr20" >
    </form>
</div>

<script>
    layui.use('form', function(){
        var form = layui.form;
        //监听提交
        form.on('submit(login)', function(data){
            var _name = $('.username').val()
            var _password = $('.pwd').val()
            $.post("/admin/changePwdPost",{password:_password},function (res) {
                if(res.error_code != 0){
                    layer.msg(res.msg,{icon:5});
                }else{
                    layer.msg("修改成功", {
                            icon: 6
                        },
                        function() {
                            // window.parent.location.reload();
                            // 获得frame索引
                            var index = parent.layer.getFrameIndex(window.name);
                            //关闭当前frame
                            parent.layer.close(index);
                        });
                }
            },'json')
            return false;
        });
    });
</script>
<!-- 底部结束 -->
</body>
</html>